set RECV_LISTEN(KICK) m_kick

proc m_kick {chid raw parent me} {
	global CHANS_$chid
	
	regexp {:([^!]+)![^ ]+ KICK ([^ ]+) ([^ ]+) :(.+)} $raw -> nick channel victim reason
	set num [set "CHANS_$chid\([string tolower $channel]\)"]
	
	if { $victim == $me } {
		deleteoutput $parent.chan$num
		warning $parent.console "[tr {You were kicked out of}] $channel ($reason)"
	} else {
		output $parent.chan$num "<- $nick [tr kicked] $victim [tr {out of}] $channel ($reason)\n" red
		raw $chid "NAMES $channel"
	}
}
